package nju.firework.res;

import nju.firework.game.main.MainActivity;

import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlas;
import org.andengine.opengl.texture.atlas.bitmap.BitmapTextureAtlasTextureRegionFactory;
import org.andengine.opengl.texture.region.TextureRegion;
import org.andengine.opengl.texture.region.TiledTextureRegion;

public class TextureFactory extends BitmapTextureAtlasTextureRegionFactory{
	
	static MainActivity mGame;
	
	public TextureFactory(MainActivity pGame){
		mGame = pGame;
	}
	
	public TiledTextureRegion createTile(final BitmapTextureAtlas pBitmapTextureAtlas, final String pAssetPath, final int pTextureX, final int pTextureY, final int pTileColumns, final int pTileRows){
		return super.createTiledFromAsset(pBitmapTextureAtlas,mGame.getAssets(), pAssetPath, pTextureX, pTextureY, pTileColumns, pTileRows);
	}
	
	public TextureRegion create(final BitmapTextureAtlas pBitmapTextureAtlas, final String pAssetPath, final int pTextureX, final int pTextureY){
		return super.createFromAsset(pBitmapTextureAtlas, mGame.getAssets(), pAssetPath, pTextureY, pTextureY);
	}
}
